import java.applet.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;


import javax.swing.*;


public class DataInjectionSwing extends Applet {
	JCheckBox ChB1;
	JLabel E1outcome;

	public void init(){
		//New comment were added
		
		JPanel panel1 = new JPanel();
		JPanel panel2 = new JPanel();
		JPanel panel3 = new JPanel();		
		String[] items = {"C++", "Java","VB","Perl"};
		JComboBox<String> CombB = new JComboBox<String>(items);
		E1outcome = new JLabel();
        
        JLabel labelCombB = new JLabel("Combobox1");
        JLabel  labelE1 = new JLabel("EditBox1");
		JLabel labelChB1 = new JLabel();
		
		ChB1 = new JCheckBox("CheckBox1"); 
		
		JButton button1 = new JButton("Submit");
		JTextField EB1 = new JTextField(10);
		
		button1.addActionListener(new buttonListener());
		
		panel1.add(labelE1);
		panel1.add (EB1);
		panel1.add (button1);
		
		panel2.add(labelChB1);
		panel2.add(ChB1);
		panel3.add(E1outcome);
			
		panel2.add(labelCombB);
		panel2.add(CombB);
		
		add(panel1);
		add(panel2);
		add(panel3);
		
		setVisible(true);
	}
	

	class buttonListener implements ActionListener {

		@Override
		public void actionPerformed(ActionEvent arg0) { 
			
			StringBuilder outcome = new StringBuilder();
			if (ChB1.isSelected()){
				outcome.append("Selected");
				
			}
			else{
				outcome.append("Not Selected");
			}
			E1outcome.setText(outcome.toString());
				
		}
		
	} 
	

}
